Particle Cloud Simulation

Using the same setup as detailed_look.jl or example2(), here we simulate a point cloud getting advected by the flow field. For additional documentation e.g. see : 1, 2, 3, 4

1. Import Software

using IndividualDisplacements, OrdinaryDiffEq, Statistics
p=dirname(pathof(IndividualDisplacements))
include(joinpath(p,"../examples/recipes_plots.jl"))
include(joinpath(p,"../examples/example123.jl"))
Main.ex-particle_cloud.OCCA_setup

2. Setup Problem

๐‘ƒ,ฮ“=example2_setup()

ii1=5:5:40; ii2=5:5:25
x=vec([x-0.5 for x in ii1, y in ii2])
y=vec([y-0.5 for x in ii1, y in ii2])
xy=transpose([x y])

๐‘ƒ.๐‘‡[:] = [0.0,2998*3600.0]
solv(prob) = solve(prob,Tsit5(),reltol=1e-6,abstol=1e-6)
tr = DataFrame( ID=[], x=[], y=[], t = [])

๐ผ = Individuals{Float64}(xy=xy[:,:], ๐‘ƒ=๐‘ƒ, โŽ”! = โฌก, โ–ก = solv, โ–ฝ = postprocess_xy, tr = tr)
Individuals{Float64}([4.5 9.5 โ€ฆ 34.5 39.5; 4.5 4.5 โ€ฆ 24.5 24.5], Int64[], 0ร—4 DataFrame
, IndividualDisplacements.dxy_dt, IndividualDisplacements.dxy_dt, Main.ex-particle_cloud.solv, IndividualDisplacements.postprocess_xy, (u0 =   data type   = Float64
  cell pos.   = [0.5, 0.5, 0.5]
  tile array  = (1,)
  tile sizes  = (80, 42)
  grid class  = PeriodicChannel
  MeshArray   = gcmarray 
  version     = 0.2.12 
, u1 =   data type   = Float64
  cell pos.   = [0.5, 0.5, 0.5]
  tile array  = (1,)
  tile sizes  = (80, 42)
  grid class  = PeriodicChannel
  MeshArray   = gcmarray 
  version     = 0.2.12 
, v0 =   data type   = Float64
  cell pos.   = [0.5, 0.5, 0.5]
  tile array  = (1,)
  tile sizes  = (80, 42)
  grid class  = PeriodicChannel
  MeshArray   = gcmarray 
  version     = 0.2.12 
, v1 =   data type   = Float64
  cell pos.   = [0.5, 0.5, 0.5]
  tile array  = (1,)
  tile sizes  = (80, 42)
  grid class  = PeriodicChannel
  MeshArray   = gcmarray 
  version     = 0.2.12 
, dx = 5000.0, ๐‘‡ = [0.0, 1.07928e7], XC =   data type   = Float32
  cell pos.   = [0.5, 0.5, 0.5]
  tile array  = (1,)
  tile sizes  = (80, 42)
  grid class  = PeriodicChannel
  MeshArray   = gcmarray 
  version     = 0.2.12 
, YC =   data type   = Float32
  cell pos.   = [0.5, 0.5, 0.5]
  tile array  = (1,)
  tile sizes  = (80, 42)
  grid class  = PeriodicChannel
  MeshArray   = gcmarray 
  version     = 0.2.12 
, ioSize = (80, 42)), NamedTuple(), NamedTuple())

3. Compute Trajectories

start!(๐ผ)
2ร—40 Array{Float64,2}:
   5.91182   10.5953   11.087   12.6622  โ€ฆ  37.9639   29.12    30.6396
 -12.3525   124.028   487.117  478.34        8.68514  19.2392  22.4415

4. Display results

๐ผ.tr.lon=5000*๐ผ.tr.x
๐ผ.tr.lat=5000*๐ผ.tr.y
plt=PlotBasic(๐ผ.tr,size(xy,2),100000.0)
0 1ร—10 5 2ร—10 5 3ร—10 5 4ร—10 5 0 5.0ร—10 4 1.0ร—10 5 1.5ร—10 5 2.0ร—10 5

Compare with trajectory output from MITgcm

#df=read_flt(joinpath(p,"../examples/flt_example/"),Float32)
#ref=PlotBasic(df,size(xy,2),100000.0)

This page was generated using Literate.jl.